<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="org.springside.modules.security.springsecurity.SpringSecurityUtils" %>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>角色授权</title>
	<%@ include file="/common/meta.jsp"%>
	<link href="${ctx}/css/default.css" type="text/css" rel="stylesheet"/>
	<link href="${ctx}/css/extremetable/extremecomponents.css" type="text/css" rel="stylesheet" />
		<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
		<script src="${ctx}/js/authority.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>
<div id="message"><s:actionmessage theme="mytheme"/></div>
<h3>角色授权</h3>
<div id="filter">操作角色：${roleName}.</div>
<input type="hidden" name="roleId" id="roleId" value="${roleId}" />

<div id="ecTable">
	<ec:table items="allAuths" var="auth"
		action="${ctx}/security/role!assignAuth.action" width="100%" filterable="true"
		 rowsDisplayed="10" sortable="true">
		<%-- 
		<ec:exportXls fileName="presidents.xls" tooltip="导出Excel"/>
		<ec:exportCsv fileName="presidents.csv" tooltip="Export CSV" delimiter="|"/>
		--%>
		<ec:row>
		<ec:column property="null" width="5%" cell="rowCount" sortable="false"  style="text-align: center" filterable="true" title="序号" />
		<ec:column property="name" width="15%" title="权限名" />
		<ec:column property="displayName" width="20%" style="text-align: left;" title="权限描述" />
		<ec:column property="" width="10%" alias="操作" style="text-align:center;" viewsAllowed="html">
			<security:authorize ifAnyGranted="A_MODIFY_USER">
			<label>授权</label><input type="checkbox" id="checkbox_${auth.id}" <c:if test='${auth.isAuthorized==1}'>checked</c:if> onclick="changeRoleAuth('${roleId}','${auth.id }')"/>
			</security:authorize>
		</ec:column>
		</ec:row>
	</ec:table>
</div>

<div id="qtableFooter">	<a href="${ctx}/security/role.action">返回角色列表</a></div>
</body>
</html>